#include "MenuSolo.h"
#include <iostream>
#include "../common/AdministradorDeNiveles.h"
#include <list>
#include <string>

MenuSolo::MenuSolo(MainJuegoLocal *m)
{
	AdministradorDeNiveles admin;
	//admin.habilitarNivel(3);
	//admin.agregarNivel("5", "common/nivel5.xml", "b");
	
	list<string> l = admin.nivelesHabilitados();
	this->m = m;
	Glib::RefPtr<Gtk::Builder> refBuilder = Gtk::Builder::create();
	refBuilder->add_from_file("./Cliente/MenuSolo.glade");

	refBuilder->get_widget("MenuSolo", main);
		
	refBuilder->get_widget("Jugar", botonJugar);
	botonJugar->signal_clicked().connect(sigc::mem_fun(*this, &MenuSolo::on_buttonJugar_clicked));
	
	refBuilder->get_widget("Nivel", botonNiveles);
	botonNiveles->set_range(1, l.size());
	botonNiveles->set_increments(1,1);
	
	//main->show_all_children();
}

void MenuSolo::correr() {
	Gtk::Main::run(*main);
}

void MenuSolo::on_buttonNivel_clicked() {
}
void MenuSolo::on_buttonJugar_clicked() {
	main->hide();
	m->crearPartidaLocal((int)(botonNiveles->get_value()));
}


MenuSolo::~MenuSolo()
{
	
}

